package com.example.demo.uitl;

import org.springframework.ai.chat.client.ChatClient;
import org.springframework.ai.chat.client.advisor.SimpleLoggerAdvisor;
import org.springframework.ai.ollama.OllamaChatModel;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.bind.annotation.RequestMapping;
@Configuration
@RequestMapping
public class CommonConfiguration {
    @Bean
    public ChatClient openAiChatClient(OllamaChatModel ollamaChatModel) {
        return ChatClient
                .builder(ollamaChatModel)
                .defaultSystem("你是一个热心的智能助手，你的名字叫小团")
                .defaultAdvisors(
                        new SimpleLoggerAdvisor()
                )
                .build();
    }
}
